{include file="admin/public/header" /}
<style type="text/css">
    #content-main{padding: 5px;}
</style>
<div class="aw-content-wrap">
    <div class="mod">
        <div class="mod-head">
            <h3>
                <ul class="nav nav-tabs">
                    <li class="active"><a href="#_members" data-toggle="tab" id="members"><?php e('会员组'); ?></a></li>
                    <li><a href="#_system" data-toggle="tab" id="system"><?php e('系统组'); ?></a></li>
                    <li><a href="#_custom" data-toggle="tab" id="custom"><?php e('特殊组'); ?></a></li>
                    <!-- <li><a href="admin/ticket/service_group_list/"><?php// e('客服组'); ?></a></li> -->
                </ul>
            </h3>
        </div>
        <div class="mod-body tab-content">
            <div class="tab-pane active" id="_members">
                <div class="table-responsive">
                    <form id="batchs_form" action="admin/ajax/save_user_group/" method="post" onsubmit="return false;">
                        <table class="table table-striped" id="members_table">
                            <thead>
                                <tr>
                                    <th><input type="checkbox" class="check-all"></th>
                                    <th>ID</th>
                                    <th><?php e('会员组名称'); ?></th>
                                    <th><?php e('威望介于'); ?></th>
                                    <th><?php e('威望系数'); ?></th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php if ($group) { foreach ($group AS $key => $val) { ?>
                                {if condition="$val['type']==1"}
                                <tr>
                                    <td><input type="checkbox" value="<?php echo $val['group_id']; ?>" name="group_ids[]"></td>
                                    <td><?php echo $val['group_id']; ?></td>
                                    <td>
                                        <input class="form-control" type="text" name="group[<?php echo $val['group_id']; ?>][group_name]" value="<?php echo $val['group_name']; ?>" />
                                    </td>
                                    <td class="form-inline">
                                        <div class="form-group">
                                            <input type="text" name="group[<?php echo $val['group_id']; ?>][reputation_lower]" value="<?php echo $val['reputation_lower']; ?>" class="form-control control-value" />
                                            ~
                                            <input type="text" name="group[<?php echo $val['group_id']; ?>][reputation_higer]" class="form-control max-value" value="<?php echo $val['reputation_higer']; ?>" />
                                        </div>
                                    </td>
                                    <td><input type="text" name="group[<?php echo $val['group_id']; ?>][reputation_factor]" class="form-control" value="<?php echo $val['reputation_factor']; ?>" /></td>
                                    <td><a href="admin/user/group_edit/group_id-<?php echo $val['group_id']; ?>" title="<?php e('权限编辑'); ?>" class="icon icon-edit md-tip"></a></td>
                                </tr>
                                {/if}
                                <?php } } ?>
                                <tr id="members_add_form" class="collapse">
                                    <td></td>
                                    <td></td>
                                    <td>
                                        <input type="text" class="form-control" name="group_new[group_name][]" placeholder="<?php e('用户组名称'); ?>" />
                                    </td>
                                    <td class="form-inline">
                                        <div class="form-group">
                                            <input class="new_input" type="text" name="group_new[reputation_lower][]" />
                                            ~ <input type="text" class="input-small max-value form-control" name="group_new[reputation_higer][]" />
                                        </div>
                                    </td>
                                    <td><input type="text" class="input-small form-control" name="group_new[reputation_factor][]" /></td>
                                    <td></td>
                                </tr>
                            </tbody>
                        </table>
                        <div class="mod-table-foot">
                            <a class="btn btn-primary add"><?php e('新增'); ?></a>
                            <a class="btn btn-primary" ><?php e('保存'); ?></a>
                            <a class="btn btn-danger" ><?php e('删除'); ?></a>
                        </div>
                    </form>
                </div>
            </div>

            <div class="tab-pane" id="_system">
                <table class="table table-striped">
                    <thead>
                        <tr>
                            <th>ID</th>
                            <th><?php e('系统组名称'); ?></th>
                            <th></th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php foreach ($group AS $key => $val) { ?>
                        {if condition="$val['type']==0"}
                        <tr>
                            <td><?php echo $val['group_id']; ?></td>
                            <td><?php echo $val['group_name']; ?></td>
                            <td><a href="admin/user/group_edit/group_id-<?php echo $val['group_id']; ?>" title="<?php e('权限编辑'); ?>" class="icon icon-edit md-tip"></a></td>
                        </tr>
                        {/if}
                        <?php } ?>
                    </tbody>
                </table>
            </div>

            <div class="tab-pane" id="_custom">
                <form method="post" action="admin/ajax/save_custom_user_group/" id="custom_form">
                <table class="table table-striped" id="custom_table">
                    <thead>
                        <tr>
                            <th><input type="checkbox" class="check-all"></th>
                            <th>ID</th>
                            <th><?php e('名称'); ?></th>
                            <th></th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php if ($group) { ?>
                        <?php foreach ($group AS $key => $val) { ?>
                        {if condition="$val['type']==1"}
                        <tr>
                            <td><input type="checkbox" value="<?php echo $val['group_id']; ?>" name="group_ids[]"></td>
                            <td><?php echo $val['group_id']; ?></td>
                            <td><input type="text" class="form-control" name="group[<?php echo $val['group_id']; ?>][group_name]" value="<?php echo $val['group_name']; ?>" /></td>
                            <td><a href="admin/user/group_edit/group_id-<?php echo $val['group_id']; ?>" title="<?php e('权限编辑'); ?>" class="icon icon-edit md-tip"></a></td>
                        </tr>
                        {/if}
                        <?php } ?>
                        <?php } ?>
                        <tr id="custom_add_form" class="collapse">
                            <td></td>
                            <td></td>
                            <td><input type="text" class="form-control" name="group_new[group_name][]" placeholder="<?php e('用户组名称'); ?>" /></td>
                            <td></td>
                        </tr>
                    </tbody>
                </table>
                </form>
                <div class="mod-table-foot">
                    <a class="btn btn-primary" ><?php e('新增'); ?></a>
                    <a class="btn btn-primary" ><?php e('保存'); ?></a>
                    <a class="btn btn-danger" ><?php e('删除'); ?></a>
                </div>
            </div>
        </div>
    </div>
</div>
{include file="admin/public/footer" /}